<?php
require_once('../../php-flite/boot.php');
if(isset($_POST['submit']) && isset($_POST['password1']) && isset($_POST['password2'])
	&& $_POST['password1'] == $_POST['password2'])
{
	$realm = FC::short_string();
	echo md5($_POST['username'] . ':' . $realm . ':' . $_POST['password1']);
	echo '<br />';
	echo $realm;
	echo '<br />';
	echo $_POST['username'];
}
?>
<html>
<body>
	<form action="/test/generate.php" method="post">
		<fieldset legend="Generate User Details">
			<label>Username
				<input type="text" value="" name="username" />
			</label>
			<br />
			<label>Password
				<input type="password" value="" name="password1" />
			</label>
			<br />
			<label>Confirm Password
				<input type="password" value="" name="password2" />
			</label>
			<br />
			<input type="submit" value="Generate" name="submit" />
		</fieldset>
	</form>
</body>
</html>